%undefine _debugsource_packages
%define pantumfile pantum-106-1.1.106-alt1.x86_64.rpm

Summary(ru_RU.UTF-8):	Драйвера Pantum
Summary:	Pantum drivers
Name:		pantum
Version:	1.1.106
Release:	1
License:	distributable
Group:		System/Configuration/Printing
Url:		https://global.pantum.com/
Vendor:		Pantum
Source0:	http://altrepo.ru/local-p10/x86_64/RPMS.local-p10/%{pantumfile}
Source1:	pantum.rpmlintrc
BuildRequires:	%{_bindir}/rpm2cpio
BuildRequires:	cpio
ExclusiveArch:	x86_64
Requires:	cups
Requires:	sane
Requires:	lib64jpeg8
Requires:	ipp-usb
Requires:	qpdf
AutoReqProv:	no

%description
CUPS and SANE drivers for Pantum series printer and scanner.

%description -l ru_RU.UTF-8
Драйвера CUPS и SANE для принтеров и сканеров Pantum.

%files
/opt/%{name}
%{_sysconfdir}/pantumwrap
%{_sysconfdir}/sane.d/dll.d/*
%{_sysconfdir}/sane.d/*.conf
%{_sysconfdir}/udev/rules.d/*
%{_libdir}/sane/*
%{_datadir}/doc/pantum-106
%{_datadir}/cups/model/Pantum
%{_usr}/lib/cups/filter/*
%{_unitdir}/pt-ipp-usb.service

#------------------------------------------------------------------

%prep
%setup -T -c
cp %sources .
rpm2cpio %{pantumfile} | cpio -idmv

%build

%install
cp -rf etc %{buildroot}
cp -rf opt %{buildroot}
cp -rf usr %{buildroot}
install -p -m644 opt/pantum/ippfilter/71-ipp-usb.rules %{buildroot}%{_sysconfdir}/udev/rules.d
mkdir -p %{buildroot}%{_unitdir}
install -p -m644 opt/pantum/ippfilter/pt-ipp-usb.service %{buildroot}%{_unitdir}
